<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.fr {
				float: right;
			}
			.fl {
				float: left;
			}
			
			.clear {
				clear: both;
			}
			
			.box1,.box2,.box3,.box4 {
				width: 200px;
				height: 200px;
				margin-top: 2px;
				background-color: #1B6D85;
			}
			
			.box1 {
				/* float: right; */
				background-color: red;
			}
			.box2 {
				/* float: right; */
				background-color: #007AFF;
			}
			
			.box3 {
				/* float: right;	 */	
				background-color: yellow;
			}
		</style>
	</head>
	<body>
		<fieldset id="">
			<legend>右浮动</legend>
			<div class="box1 fr"></div>
			<div class="box2 fr"></div>
			<div class="box3 fr"></div>
			<!-- 下面这个div没有别的作用,没有宽和高，就是为了消除浮动对其他元素的影响 -->
			<div class="clear"></div>
			<div class="box4"></div>
		</fieldset>
		
		<fieldset id="">
			<legend>左浮动</legend>
			<div class="box1 fl"></div>
			<div class="box2 fl"></div>
			<div class="box3 fl"></div>
			<div class="clear"></div>
		</fieldset>
	</body>
</html>
